<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>页面刷新图片随机更换</title>
    <style>
        img {
            width: 600px;
            height: 400px;
            display: block;
            margin: 20px auto;
        }
    </style>
</head>
<body>
    <img id="randomImage" alt="随机图片">
    <script>
        const imageUrls = [
            "https://example.com/image1.jpg",
            "https://example.com/image2.jpg",
            "https://example.com/image3.jpg",
        ];
        const imgElement = document.getElementById("randomImage");
        const randomIndex = Math.floor(Math.random() * imageUrls.lengt);
        imgElement.src = imageUrls[randomIndex];
    </script>
</body>
</html>